home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / U-Z / VideoToolbox 4.95.sit / VideoToolbox / VideoToolboxSources / kbhit.c < prev    next >
MacBinary  |  1995-03-21  |  2.5 KB  |  [TEXT/MMCC]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Tue Mar 21 09:36:45 1995, modified Tue Mar 21 09:36:45 1995, creator 'MMCC', type ASCII, 1667 bytes "kbhit.c" , at 0x703 532 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MMCC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 07 6b 62 68 69 74 2e | 63 00 00 00 00 00 00 00 |..kbhit.|c.......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 00 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 06 83 00 | 00 02 14 ab 94 94 fd ab |........|........|
|00000060| 94 94 fd 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 b1 11 00 00 |........|........|
|00000080| 2f 2a 0d 6b 62 68 69 74 | 2e 63 0d 6b 62 68 69 74 |/*.kbhit|.c.kbhit|
|00000090| 28 29 20 72 65 74 75 72 | 6e 73 20 31 20 69 66 20 |() retur|ns 1 if |
|000000a0| 61 20 6b 65 79 70 72 65 | 73 73 20 61 77 61 69 74 |a keypre|ss await|
|000000b0| 73 20 70 72 6f 63 65 73 | 73 69 6e 67 2c 20 30 20 |s proces|sing, 0 |
|000000c0| 6f 74 68 65 72 77 69 73 | 65 2e 0d 67 65 74 63 68 |otherwis|e..getch|
|000000d0| 61 72 55 6e 62 75 66 66 | 65 72 65 64 28 29 20 61 |arUnbuff|ered() a|
|000000e0| 6c 77 61 79 73 20 72 65 | 74 75 72 6e 73 20 69 6d |lways re|turns im|
|000000f0| 6d 65 64 69 61 74 65 6c | 79 2e 20 49 74 20 72 65 |mediatel|y. It re|
|00000100| 74 75 72 6e 73 20 76 61 | 6c 75 65 20 2d 31 20 69 |turns va|lue -1 i|
|00000110| 66 20 74 68 65 72 65 27 | 73 20 0d 6e 6f 20 63 68 |f there'|s .no ch|
|00000120| 61 72 61 63 74 65 72 20 | 74 6f 20 72 65 74 75 72 |aracter |to retur|
|00000130| 6e 2e 0d 0d 67 65 74 63 | 68 61 72 55 6e 62 75 66 |n...getc|harUnbuf|
|00000140| 66 65 72 65 64 28 29 20 | 69 73 20 75 73 65 64 20 |fered() |is used |
|00000150| 62 79 20 43 68 6f 6f 73 | 65 2e 63 0d 0d 36 2f 31 |by Choos|e.c..6/1|
|00000160| 33 2f 39 30 09 64 67 70 | 20 77 72 6f 74 65 20 6b |3/90.dgp| wrote k|
|00000170| 62 68 69 74 2c 20 62 61 | 73 65 64 20 6f 6e 20 73 |bhit, ba|sed on s|
|00000180| 75 67 67 65 73 74 69 6f | 6e 20 66 72 6f 6d 20 4d |uggestio|n from M|
|00000190| 69 63 68 61 65 6c 20 4b | 61 68 6c 20 61 6e 64 20 |ichael K|ahl and |
|000001a0| 61 6e 20 65 61 72 6c 69 | 65 72 20 76 65 72 73 69 |an earli|er versi|
|000001b0| 6f 6e 20 62 79 0d 09 09 | 45 76 61 6e 20 52 65 6c |on by...|Evan Rel|
|000001c0| 6b 69 6e 2e 0d 31 32 2f | 32 35 2f 39 33 20 64 67 |kin..12/|25/93 dg|
|000001d0| 70 20 63 6f 73 6d 65 74 | 69 63 20 65 64 69 74 69 |p cosmet|ic editi|
|000001e0| 6e 67 0d 38 2f 31 2f 39 | 34 20 64 67 70 20 61 64 |ng.8/1/9|4 dgp ad|
|000001f0| 64 65 64 20 73 75 70 70 | 6f 72 74 20 66 6f 72 20 |ded supp|ort for |
|00000200| 4d 65 74 72 6f 57 65 72 | 6b 73 20 43 6f 64 65 57 |MetroWer|ks CodeW|
|00000210| 61 72 72 69 6f 72 20 43 | 20 33 2e 35 2e 0d 31 30 |arrior C| 3.5..10|
|00000220| 2f 31 2f 39 34 20 64 67 | 70 20 75 70 64 61 74 65 |/1/94 dg|p update|
|00000230| 64 20 66 6f 72 20 4d 65 | 74 72 6f 57 65 72 6b 73 |d for Me|troWerks|
|00000240| 20 43 6f 64 65 57 61 72 | 72 69 6f 72 20 43 20 34 | CodeWar|rior C 4|
|00000250| 2e 35 2c 20 77 68 69 63 | 68 20 73 74 69 6c 6c 20 |.5, whic|h still |
|00000260| 64 6f 65 73 6e 27 74 20 | 73 75 70 70 6f 72 74 0d |doesn't |support.|
|00000270| 09 09 75 6e 62 75 66 66 | 65 72 65 64 20 69 6e 70 |..unbuff|ered inp|
|00000280| 75 74 20 66 72 6f 6d 20 | 74 68 65 20 63 6f 6e 73 |ut from |the cons|
|00000290| 6f 6c 65 2e 0d 31 30 2f | 38 2f 39 34 09 64 67 70 |ole..10/|8/94.dgp|
|000002a0| 20 44 69 73 63 6f 76 65 | 72 65 64 20 74 68 61 74 | Discove|red that|
|000002b0| 20 47 65 74 4e 65 78 74 | 45 76 65 6e 74 28 29 20 | GetNext|Event() |
|000002c0| 77 6f 72 6b 73 20 66 69 | 6e 65 20 66 6f 72 20 75 |works fi|ne for u|
|000002d0| 6e 62 75 66 66 65 72 65 | 64 20 69 6e 70 75 74 2e |nbuffere|d input.|
|000002e0| 0d 31 2f 37 2f 39 35 09 | 64 67 70 20 55 70 64 61 |.1/7/95.|dgp Upda|
|000002f0| 74 65 64 20 74 6f 20 74 | 61 6b 65 20 61 64 76 61 |ted to t|ake adva|
|00000300| 6e 74 61 67 65 20 6f 66 | 20 74 68 65 20 43 57 35 |ntage of| the CW5|
|00000310| 20 53 49 4f 55 58 20 63 | 6f 6e 73 6f 6c 65 27 73 | SIOUX c|onsole's|
|00000320| 20 6e 65 77 20 61 62 69 | 6c 69 74 79 20 74 6f 20 | new abi|lity to |
|00000330| 68 61 6e 64 6c 65 20 61 | 6e 20 65 76 65 6e 74 2e |handle a|n event.|
|00000340| 0d 2a 2f 0d 23 69 6e 63 | 6c 75 64 65 20 22 56 69 |.*/.#inc|lude "Vi|
|00000350| 64 65 6f 54 6f 6f 6c 62 | 6f 78 2e 68 22 0d 23 69 |deoToolb|ox.h".#i|
|00000360| 66 20 28 54 48 49 4e 4b | 5f 43 20 7c 7c 20 54 48 |f (THINK|_C || TH|
|00000370| 49 4e 4b 5f 43 50 4c 55 | 53 29 0d 09 23 69 6e 63 |INK_CPLU|S)..#inc|
|00000380| 6c 75 64 65 20 3c 63 6f | 6e 73 6f 6c 65 2e 68 3e |lude <co|nsole.h>|
|00000390| 0d 23 65 6e 64 69 66 0d | 23 69 66 20 5f 5f 4d 57 |.#endif.|#if __MW|
|000003a0| 45 52 4b 53 5f 5f 0d 09 | 23 69 6e 63 6c 75 64 65 |ERKS__..|#include|
|000003b0| 20 3c 63 6f 6e 73 6f 6c | 65 2e 68 3e 0d 09 23 69 | <consol|e.h>..#i|
|000003c0| 6e 63 6c 75 64 65 20 3c | 53 49 4f 55 58 2e 68 3e |nclude <|SIOUX.h>|
|000003d0| 0d 23 65 6e 64 69 66 0d | 0d 69 6e 74 20 6b 62 68 |.#endif.|.int kbh|
|000003e0| 69 74 28 76 6f 69 64 29 | 0d 7b 0d 09 23 69 66 20 |it(void)|.{..#if |
|000003f0| 28 54 48 49 4e 4b 5f 43 | 20 7c 7c 20 54 48 49 4e |(THINK_C| || THIN|
|00000400| 4b 5f 43 50 4c 55 53 29 | 0d 09 09 69 6e 74 20 63 |K_CPLUS)|...int c|
|00000410| 3b 0d 09 0d 09 09 63 3d | 67 65 74 63 68 61 72 55 |;.....c=|getcharU|
|00000420| 6e 62 75 66 66 65 72 65 | 64 28 29 3b 0d 09 09 69 |nbuffere|d();...i|
|00000430| 66 28 63 3d 3d 45 4f 46 | 29 72 65 74 75 72 6e 20 |f(c==EOF|)return |
|00000440| 30 3b 0d 09 09 75 6e 67 | 65 74 63 28 63 2c 73 74 |0;...ung|etc(c,st|
|00000450| 64 69 6e 29 3b 0d 09 09 | 72 65 74 75 72 6e 20 31 |din);...|return 1|
|00000460| 3b 0d 09 23 65 6c 73 65 | 0d 09 09 45 76 65 6e 74 |;..#else|...Event|
|00000470| 52 65 63 6f 72 64 20 65 | 76 65 6e 74 3b 0d 09 09 |Record e|vent;...|
|00000480| 0d 09 09 72 65 74 75 72 | 6e 20 45 76 65 6e 74 41 |...retur|n EventA|
|00000490| 76 61 69 6c 28 6b 65 79 | 44 6f 77 6e 4d 61 73 6b |vail(key|DownMask|
|000004a0| 2c 26 65 76 65 6e 74 29 | 3b 0d 09 23 65 6e 64 69 |,&event)|;..#endi|
|000004b0| 66 0d 7d 0d 0d 69 6e 74 | 20 67 65 74 63 68 61 72 |f.}..int| getchar|
|000004c0| 55 6e 62 75 66 66 65 72 | 65 64 28 76 6f 69 64 29 |Unbuffer|ed(void)|
|000004d0| 0d 7b 0d 09 69 6e 74 20 | 63 3b 0d 09 23 69 66 20 |.{..int |c;..#if |
|000004e0| 28 54 48 49 4e 4b 5f 43 | 20 7c 7c 20 54 48 49 4e |(THINK_C| || THIN|
|000004f0| 4b 5f 43 50 4c 55 53 29 | 0d 0d 09 09 63 73 65 74 |K_CPLUS)|....cset|
|00000500| 6d 6f 64 65 28 43 5f 52 | 41 57 2c 73 74 64 69 6e |mode(C_R|AW,stdin|
|00000510| 29 3b 09 09 2f 2a 20 75 | 6e 62 75 66 66 65 72 65 |);../* u|nbuffere|
|00000520| 64 3a 20 6e 6f 20 65 63 | 68 6f 2c 20 6e 6f 20 65 |d: no ec|ho, no e|
|00000530| 64 69 74 69 6e 67 20 2a | 2f 0d 09 09 63 3d 67 65 |diting *|/...c=ge|
|00000540| 74 63 68 61 72 28 29 3b | 0d 09 09 63 73 65 74 6d |tchar();|...csetm|
|00000550| 6f 64 65 28 43 5f 45 43 | 48 4f 2c 73 74 64 69 6e |ode(C_EC|HO,stdin|
|00000560| 29 3b 09 09 2f 2a 20 64 | 65 66 61 75 6c 74 20 6d |);../* d|efault m|
|00000570| 6f 64 65 3a 20 6c 69 6e | 65 2d 62 75 66 66 65 72 |ode: lin|e-buffer|
|00000580| 65 64 2c 20 65 63 68 6f | 2c 20 66 75 6c 6c 20 65 |ed, echo|, full e|
|00000590| 64 69 74 69 6e 67 20 2a | 2f 0d 09 23 65 6c 73 65 |diting *|/..#else|
|000005a0| 0d 09 09 45 76 65 6e 74 | 52 65 63 6f 72 64 20 65 |...Event|Record e|
|000005b0| 76 65 6e 74 3b 0d 0d 09 | 09 77 68 69 6c 65 28 21 |vent;...|.while(!|
|000005c0| 47 65 74 4e 65 78 74 45 | 76 65 6e 74 28 6b 65 79 |GetNextE|vent(key|
|000005d0| 44 6f 77 6e 4d 61 73 6b | 2c 26 65 76 65 6e 74 29 |DownMask|,&event)|
|000005e0| 29 7b 0d 09 09 09 23 69 | 66 20 5f 5f 4d 57 45 52 |){....#i|f __MWER|
|000005f0| 4b 53 5f 5f 0d 09 09 09 | 09 2f 2f 20 41 6c 6c 6f |KS__....|.// Allo|
|00000600| 77 20 74 68 65 20 63 6f | 6e 73 6f 6c 65 20 74 6f |w the co|nsole to|
|00000610| 20 72 65 73 70 6f 6e 64 | 20 74 6f 20 74 68 65 20 | respond| to the |
|00000620| 6d 6f 75 73 65 2c 20 65 | 2e 67 2e 20 64 72 61 67 |mouse, e|.g. drag|
|00000630| 2c 20 7a 6f 6f 6d 2c 20 | 6f 72 20 72 65 73 69 7a |, zoom, |or resiz|
|00000640| 65 2e 0d 09 09 09 09 69 | 66 28 47 65 74 4e 65 78 |e......i|f(GetNex|
|00000650| 74 45 76 65 6e 74 28 6d | 44 6f 77 6e 4d 61 73 6b |tEvent(m|DownMask|
|00000660| 7c 6d 55 70 4d 61 73 6b | 2c 26 65 76 65 6e 74 29 ||mUpMask|,&event)|
|00000670| 29 53 49 4f 55 58 48 61 | 6e 64 6c 65 4f 6e 65 45 |)SIOUXHa|ndleOneE|
|00000680| 76 65 6e 74 28 26 65 76 | 65 6e 74 29 3b 0d 09 09 |vent(&ev|ent);...|
|00000690| 09 23 65 6e 64 69 66 0d | 09 09 7d 0d 09 09 63 3d |.#endif.|..}...c=|
|000006a0| 65 76 65 6e 74 2e 6d 65 | 73 73 61 67 65 26 63 68 |event.me|ssage&ch|
|000006b0| 61 72 43 6f 64 65 4d 61 | 73 6b 3b 0d 09 09 69 66 |arCodeMa|sk;...if|
|000006c0| 28 63 3d 3d 27 2e 27 20 | 26 26 20 28 65 76 65 6e |(c=='.' |&& (even|
|000006d0| 74 2e 6d 6f 64 69 66 69 | 65 72 73 26 63 6d 64 4b |t.modifi|ers&cmdK|
|000006e0| 65 79 29 29 61 62 6f 72 | 74 28 29 3b 0d 09 23 65 |ey))abor|t();..#e|
|000006f0| 6e 64 69 66 0d 09 72 65 | 74 75 72 6e 20 63 3b 0d |ndif..re|turn c;.|
|00000700| 7d 0d 0d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |}.......|........|
|00000710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000780| 00 00 01 00 00 00 01 9a | 00 00 00 9a 00 00 00 7a |........|.......z|
|00000790| 61 69 6e 20 73 63 72 65 | 65 6e 20 56 42 4c 20 71 |ain scre|en VBL q|
|000007a0| 75 65 75 65 2a 2f 0d 20 | 20 20 20 53 6c 6f 74 54 |ueue*/. | SlotT|
|000007b0| 07 6b 62 68 69 74 2e 63 | 02 00 00 00 50 61 72 74 |.kbhit.c|....Part|
|000007c0| 53 49 54 21 00 00 00 00 | 00 00 00 00 00 00 5f aa |SIT!....|......_.|
|000007d0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 ab bf ee 63 00 00 | 00 00 00 00 02 14 61 62 |.....c..|......ab|
|00000800| 6c 65 53 65 65 64 20 3d | 20 30 78 30 44 32 30 2c |leSeed =| 0x0D20,|
|00000810| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 5b | | /*[|
|00000820| 47 4c 4f 42 41 4c 20 56 | 41 52 5d 20 20 28 6c 6f |GLOBAL V|AR] (lo|
|00000830| 6e 67 29 20 73 65 65 64 | 20 76 61 6c 75 65 20 66 |ng) seed| value f|
|00000840| 6f 72 20 63 6f 6c 6f 72 | 20 74 61 62 6c 65 20 49 |or color| table I|
|00000850| 44 27 73 2a 2f 0d 20 20 | 20 20 53 52 73 72 63 54 |D's*/. | SRsrcT|
|00000860| 62 6c 50 74 72 20 3d 20 | 30 78 30 44 32 34 20 20 |blPtr = |0x0D24 |
|00000870| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 5b 47 4c 4f | | /*[GLO|
|00000880| 00 00 00 0a 00 00 03 73 | ff ff 00 00 00 00 00 00 |.......s|........|
|00000890| 00 12 00 01 00 10 00 00 | 03 c9 00 25 00 e6 b9 6c |........|...%...l|
|000008a0| 10 04 01 63 00 00 00 1e | 00 8e 00 16 01 ba 02 60 |...c....|.......`|
|000008b0| 00 8e 00 16 01 ba 02 60 | 00 00 00 00 00 00 00 00 |.......`|........|
|000008c0| 00 00 00 00 00 00 00 00 | 00 48 00 09 4d 6f 6e 61 |........|.H..Mona|
|000008d0| 63 6f 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |co......|........|
|000008e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 03 00 04 |........|........|
|000008f0| 00 3e 00 04 01 8c 02 7c | 00 3e 00 04 01 8c 02 7c |.>.....||.>.....||
|00000900| ab b0 ad a4 00 00 06 64 | 00 00 06 69 00 00 04 01 |.......d|...i....|
|00000910| 00 00 00 00 00 04 00 01 | 00 01 00 00 01 00 00 00 |........|........|
|00000920| 01 9a 00 00 00 9a 00 00 | 00 7a 00 6a d5 18 29 80 |........|.z.j..).|
|00000930| 00 00 00 1c 00 7a 00 03 | 4d 50 53 52 00 01 00 22 |.....z..|MPSR..."|
|00000940| 42 4b 50 54 00 00 00 3a | 44 54 56 55 00 00 00 46 |BKPT...:|DTVU...F|
|00000950| 4d 57 42 42 00 00 00 52 | 03 f0 ff ff 00 00 00 24 |MWBB...R|.......$|
|00000960| 00 00 00 00 03 ed ff ff | 00 00 00 46 00 00 00 00 |........|...F....|
|00000970| 42 1f ff ff 00 00 00 00 | 00 00 00 00 58 03 ff ff |B.......|....X...|
|00000980| 00 00 00 0e 00 00 00 00 | 03 f0 ff ff 00 00 00 92 |........|........|
|00000990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+